package com.ucode.model.cgms.form;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.math.BigDecimal;

/**
 * 返点流水表单
 * @Author: Claude
 * @Date: 2023/05/26 10:45
 * @Version: 1.0
 */
@Schema(description = "返点流水表单")
@Data
public class CgmsRebateFlowForm {

    /**
     * 用户ID
     */
    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    /**
     * 订单ID
     */
    @Schema(description = "订单ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "订单ID不能为空")
    private Long orderId;
    
    /**
     * 订单编号
     */
    @Schema(description = "订单编号")
    private String orderNo;

    /**
     * 返点金额
     */
    @Schema(description = "返点金额", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "返点金额不能为空")
    @DecimalMin(value = "0.01", message = "返点金额必须大于0")
    private BigDecimal amount;
    
    /**
     * 返点类型(1-陪玩订单返点 2-俱乐部返点)
     */
    @Schema(description = "返点类型(1-陪玩订单返点 2-俱乐部返点)", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "返点类型不能为空")
    @Min(value = 1, message = "返点类型无效")
    @Max(value = 2, message = "返点类型无效")
    private Integer rebateType;
    
    /**
     * 关联用户ID(邀请人)
     */
    @Schema(description = "关联用户ID(邀请人)", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "关联用户ID不能为空")
    private Long relatedUserId;
    
    /**
     * 返点比例
     */
    @Schema(description = "返点比例", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "返点比例不能为空")
    @DecimalMin(value = "0.01", message = "返点比例必须大于0")
    private BigDecimal rebateRate;
    
    /**
     * 状态(0-待结算 1-已结算 2-已取消)
     */
    @Schema(description = "状态(0-待结算 1-已结算 2-已取消)")
    private Integer statuz;
    
    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;
} 